<div class="page_title">
    <span class="title_icon"> <span class="blocks_images"></span></span>
    <h3>
        <?php echo $this->Html->link('Nuevo Laboratorio', array('action'=>'add'), array('escape'=>false));?>
    </h3>    
</div>
<div id="content">
    <div class="grid_container">
        <div class="grid_12">
            <div class="widget_wrap">
                <div class="widget_top">
                    <span class="h_icon blocks_images"></span>
                    <h6>Listado de los laboratorios</h6>
                </div>
                <div class="widget_content">
                    <table class="display data_tbl">
                        <thead>
                            <tr>
                                <th>SubCategoria</th>
                                <th>Nombre</th>
                                <th>Descripcion</th>
                                <th>Tipo</th>                              
                                <th style="width:120px">Acciones</th>
                            </tr>
                        </thead>
                        <tbody>

                            <?php $i=1; foreach ($laboratorios as $med):
                            ?>
                                <tr class="gradeA">
                                    <!-- <td><?php echo $i; $i++;?></td> -->
                                    <td><?php echo $med['Subclaseslaboratorio']['nombre']; ?></td>
                                    <td><?php echo $med['Laboratorio']['nombre']; ?></td>
                                    <td><?php echo $med['Laboratorio']['descripcion']; ?></td>
                                    <!-- 1=campo abierto 2=seleccionable 3=con rangos -->
                                    <td>
                                        <?php if ($med['Laboratorio']['tipo']==1): ?>
                                            <?php echo "campo abierto"; ?>   
                                        <?php elseif ($med['Laboratorio']['tipo']==2): ?>
                                            <?php echo "seleccionable"; ?>                                        
                                        <?php else: ?>
                                             <?php echo "con rangos"; ?>                                         
                                        <?php endif; ?>
                                    </td>
                                    <td>
                                        <?php echo $this->Html->link($this->Html->image("iconos/edit.png", array("alt"=>'edit', 'title'=>'EDITAR')), array('action'=>'edit', $med['Laboratorio']['id']), array('escape'=>false));?>

                                        <?php echo $this->Html->link($this->Html->image("iconos/cancel.png", array("alt"=>'delete', 'title'=>'ELIMINAR')), array('action'=>'delete', $med['Laboratorio']['id']), array('escape'=>false),'esta seguro de eliminar '.$med['Laboratorio']['nombre']);?>

                                        <?php if ($med['Laboratorio']['tipo']==3): ?>                     
                                        <?php echo $this->Html->image("iconos/rangos.png",array('title'=>'RANGOS', 'url'=>array('action'=>'rangos', $med['Laboratorio']['id'])));?>
                                        <?php elseif($med['Laboratorio']['tipo']==2): ?>
                                            <?php echo $this->Html->image("iconos/parametros.png",array('title'=>' PARAMETROS', 'url'=>array('action'=>'parametros', $med['Laboratorio']['id'])));?>
                                        <?php else: ?>                         
                                        <?php endif; ?>      
                                    </td>
                                </tr>
                            <?php endforeach; ?>
                        </tbody>                        
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

